#逛逛app接口nginx构建脚本
#Version 1.0

#Base images
FROM centos:7

#MAINTAINER
MAINTAINER 475281441@qq.com

#  设置时区
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

#ENV
ENV 	PATH 	/usr/local/nginx/sbin:$PATH

#ADD
ADD	nginx-1.16.1.tar.gz /usr/local/

#RUN
RUN yum install -y gcc gcc-c++ glibc make autoconf openssl openssl-devel&&\
    yum install -y libxslt-devel -y gd gd-devel GeoIP GeoIP-devel pcre pcre-devel&&\
    useradd -s /sbin/nglogin -M www
#WORKDIR
WORKDIR /usr/local/nginx-1.16.1

RUN ./configure --user=www --group=www --prefix=/usr/local/nginx --with-file-aio --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module && make && make install

WORKDIR /usr/local

RUN rm -rf nginx-1.16.1

#EXPORT
EXPOSE 80

CMD ["/usr/local/nginx/sbin/nginx","-g","daemon off;"]
